#include <memory>
#include "udp_server.hpp"

static void Usage(std::string proc)
{
    std::cout << "\nUsage" << proc << " port\n" << std::endl;
}

int main(int argc, char* argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(1);
    }

    uint16_t port = atoi(argv[1]);   // 把字符串转成整型
    std::unique_ptr<Udpserver> srv(new Udpserver(port));  // 使用unqie_ptr

    srv->initServer();
    srv->strat();
    return 0;
}